<style>
.css{background-color:#efefef;color:000000;border:1}
</style>
<script language="JavaScript">
//<!--

function f_initOther() {
	var isContracted= document.all("base_material_modify.is_contracted").value;
	if(isContracted=="1"){
		document.all("base_material_modify.material_style").readOnly=true;
		document.all("base_material_modify.material_style").className="css";
		document.all("base_material_modify.material_standard").readOnly=true;
		document.all("base_material_modify.material_standard").className="css";
		document.all("base_material_modify.material_material").readOnly=true;
		document.all("base_material_modify.material_material").className="css";
		document.all("base_material_modify.material_weight").readOnly=true;
		document.all("base_material_modify.material_weight").className="css";
		document.all("base_material_modify.material_weight1").readOnly=true;
		document.all("base_material_modify.material_weight1").className="css";
		document.all("base_material_modify.material_unit").readOnly=true;
		document.all("base_material_modify.material_unit").className="css";
	}
}

function f_doOthers(){
 var dedevtypeCode = document.all("base_material_modify.dedevtype_code").value;
 var dedeviceCode = document.all("base_material_modify.dedevice_code").value;
 if(dedevtypeCode!=null && dedevtypeCode!="" && dedevtypeCode != "bjyh"){
     if(dedeviceCode==null || dedeviceCode==""){
         alert('<eam:message key="text.base.material.dedevicecode" />');
	 return false;
     }else{
	 if(dedevtypeCode!=dedeviceCode.substring(0,2).toLowerCase()){
		alert('<eam:message key="text.base.material.dedevicecode2" />');
		return false;
	 }
     }
 }else{
     if(dedevtypeCode!=dedeviceCode.substring(0,2).toLowerCase())
     {
         alert('<eam:message key="text.base.material.dedevicecode2" />');
	 return false;
     }
 }
 return true;
}
//-->
</script>